package org.example.translate_braille.handler.exception;


import org.example.translate_braille.resdata.DataEnum;
import org.example.translate_braille.resdata.X;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class ResException {


	@ExceptionHandler(Exception.class)
	public X exceptionH(Exception e){
		e.printStackTrace();
		return X.ResData(DataEnum.SYS_EXCEPTION,null);
	}

	@ExceptionHandler(BusinessException.class)
	public X exceptionB(BusinessException e){
		return X.ResData(DataEnum.CUSTOM_EXCEPTION, e.getMsg());
	}



}
